package com.oocl.chatroom.client.sender;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.PrintWriter;

import org.json.JSONObject;

import com.oocl.chatroom.network.protocol.Message;

public class ClientSender {
	
	private PrintWriter out;
	
	public ClientSender(PrintWriter out){
		
		this.out = out;
	}
	
	public void send(Message msg) throws IOException {
		JSONObject jOb = new JSONObject(msg);
		String json = jOb.toString();
		System.out.println("发送  ："+json);
		out.println(json);
		out.flush();
	}

	
}
